﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace DemoConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            ProcessClasses(2000000);
            ProcessValueTypes(2000000);
        }

        public static void ProcessClasses(int count)
        {
            ArrayList widgets = new ArrayList();
            for (int i = 0; i < count; i++)
                widgets.Add(new WidgetClass(i, "Test"));

            string[] names = new string[count];
            for (int i = 0; i < count; i++)
                names[i] = ((WidgetClass)widgets[i]).Name;
        }

        public static void ProcessValueTypes(int count)
        {
            ArrayList widgets = new ArrayList();
            for (int i = 0; i < count; i++)
                widgets.Add(new WidgetValueType(i, "Test"));

            string[] names = new string[count];
            for (int i = 0; i < count; i++)
                names[i] = ((WidgetValueType)widgets[i]).Name;
        }

    }
}
